﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using AnyOffice.Model;


namespace AnyOffice.general.meeting.room
{
    public partial class _new : ModulePage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Page.IsPostBack)
            {
                this.pnlMain.Visible = false;
                MeetingRoomDao dao = new MeetingRoomDao();
                MeetingRoomData data = new MeetingRoomData();
                data.Name = this.txtName.Value;
                if (this.txtCapacity.Value != string.Empty)
                {
                    data.Capacity = this.txtCapacity.Value;
                }
                if (this.txtDevice.Value != string.Empty)
                {
                    data.Device = this.txtDevice.Value;
                }
                if (this.txtDescription.Value != string.Empty)
                {
                    data.Description = this.txtDescription.Value;
                }
                if (this.txtPlace.Value != string.Empty)
                {
                    data.Place = this.txtPlace.Value;
                }
                dao.Insert(base.Conn, data);
                this.litMessage.Text = base.ShowPrompt("添加会议室成功！", "index.aspx");
            }
        } 

    }
}
